<?php

namespace app\api\controller\dati;

use app\api\controller\Base;
use app\api\controller\Utils;

/**
 * 脑力答题接口
 */
class Naoli extends Base
{

    // 获取10个不重复的问题
    public function get_questions()
    {
        $util = new Utils();
        $list = $util->get_rand(10, 'naoli_question');
        $this->result('question list', $list);
    }

    // 获取结果图
    public function get_img_src()
    {
        $v = $this->request->param('v');
        $type = $this->request->param('type');
        return 'https://xcx-1256535092.cos.ap-shanghai.myqcloud.com/naolidati/result/' . $type . '.png';
    }

    // 配置
    public function config($v)
    {
        $shareflag = true;
        $moreflag = true;

        if ($v == '0.0.0') {
            $shareflag = false;
            $moreflag = false;
        }

        $flags = array(
            'shareflag' => $shareflag,
            'moreflag' => $moreflag,
        );

        $this->result('wx3d3d7bd50ac38ff1', $flags);
    }

}
